<?php


namespace app\common\model\log;

use tmcore\base\BaseModel;
use tmcore\traits\ModelTrait;

/**
 * 操作日志模型
 */
class OperationLog extends BaseModel
{
    use ModelTrait;

    public static string $error = '';
    public static string $trace = '';

    /**
     * 状态描述
     * @param $value
     * @param $data
     * @return string
     */
    public function getStatusDescAttr($value, $data)
    {
        if($data['status'] == 0) {
            return '系统错误';
        } elseif ($data['status'] == 1) {
            return '成功';
        } else {
            return '失败';
        }
    }
}